package guda.demox.biz.form;


import guda.demox.common.validator.Valid;
import guda.demox.common.validator.ValidType;
import guda.demox.dal.model.BlogDO;

/**
 * Created by well on 2017/3/24.
 */
public class BlogForm {

    @Valid(type={ValidType.NotEmpty},msg = "不能为空" ,showName = "博客标题")
    private String blogTitle;

    @Valid(type={ValidType.NotEmpty},msg = "不能为空" ,showName = "内容")
    private String blogContent;

    @Valid(type={ValidType.NotNull},msg = "不能为空" ,showName = "状态")
    private Integer blogStatus;

    public BlogDO toDO(){
        BlogDO blogDO=new BlogDO();
        blogDO.setBlogContent(blogContent);
        blogDO.setBlogTitle(blogTitle);
        blogDO.setBlogStatus(blogStatus);
        return blogDO;
    }


    public String getBlogTitle() {
        return blogTitle;
    }

    public void setBlogTitle(String blogTitle) {
        this.blogTitle = blogTitle;
    }

    public String getBlogContent() {
        return blogContent;
    }

    public void setBlogContent(String blogContent) {
        this.blogContent = blogContent;
    }

    public Integer getBlogStatus() {
        return blogStatus;
    }

    public void setBlogStatus(Integer blogStatus) {
        this.blogStatus = blogStatus;
    }
}
